package excercise;

public class Private연습 {

	
	
	public static void main(String[] args) {
		 RetangleVO2 rv2= new RetangleVO2(5, 5, "silver");
		 rv2.setWidth(5);
         rv2.setHeight(5);
         rv2.setColor("silver" );
		
         System.out.println("사각형의 넓이 : " + RetangleService. GetArea  (rv2.getWidth(), rv2.getHeight())  );
		 System.out.println("사각형의 둘레 : " + RetangleService. getPerimeter  (rv2.getWidth() , rv2.getHeight()) );
		 System.out.println("사각형의 색상 : " +  rv2. getColor() );
		 System.out.println(   );
	
		 
		//두번째   
         AccountVO2 av = new AccountVO2(1122, 20000, 4.5f);
			av.setAid(11_22);
			av.setBalance(20000);
			av.setInterestRate(4.5f);
			av.setDateCreated(20131109);
		    System.out.println("계좌번호 : " + av.getAid());
			System.out.println("통장잔액 : " + av.getBalance());
			System.out.println("월간 이자율 : " + AccountService. getMonthlyInterestRate(av.getInterestRate() ) );
			System.out.println("통장 개설 날짜 : " + av.getDateCreated());
		    System.out.println("1차 통장 잔액 : " + AccountService. withDraw(av.getBalance(), 2500));
			System.out.println("2차 통장 잔액 : " + AccountService. withDraw(av.getBalance(), 3000));	 
		 
		 
	}//

}//main

 
class RetangleVO3{
	private float width = 1.0f;
	private float height = 1.0f;
	private String color = "white";
	
	public RetangleVO3(float width, float height, String color) { }  // 먼저 메소드 만들어주고 
	
	public void setWidth(float width){ 
	   this.width = width;
	}
	public float getWidth(){
		return this.width;
	}
	 
	public void setHeight(float height){ 
		this.height = height;
	}
	
	public float getHeight(){
	   return this. height; }
	
	
	public void setColor(String color){ 
		this.color = color;
	}
	
    public String getColor(){
		return this.color ;
	}
} // private값 세팅


class RetangleService2 {
	static float GetArea(float width, float height) {
		return width * height;
	}
	
	static float getPerimeter(float width, float height) {
		return (2 * width) + (2 * height);
	}
} //private 수식 세팅



class AccountVO2 {
	 private int aid = 0;
	 private int balance = 0;
	 private float interestRate = 0;
	 private int dateCreated = 0;
		
		
		
		
		
   public AccountVO2(int aid, int balance, float interestRate) {}
		
	    public void setAid (int aid){
             this.aid=aid;
	    }
       public int getAid(){
           	  return this.aid;
         }
       public void setBalance (int balance){
             this.balance=balance;
       }   	  
       public int getBalance(){
             return this.balance;
             }
       public void setInterestRate(float interestRate){
             this.interestRate=interestRate;
       }  	  
       public float getInterestRate(){
            return this.interestRate;
             }
       
       public void setDateCreated(int dateCreated){
    	     this.dateCreated=dateCreated;
       }
       public int getDateCreated(){ 
    	   return this.dateCreated ;
       }
       
       
        
}//	  private 값 정하기 
 
		
class AccountService2 {
	static float getMonthlyInterestRate(float interestRate) {
		return interestRate / 12;
	}
	
	static int withDraw(int balance, int draw) {
		return balance - draw;
	}
	
	static int deposit(int balance, int depo) {
		return balance + depo;
	}
}// 계산식